package hu.ikti.oamadmin.types.entities;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Table;

@Entity
@Table(name = "REQUIREMENT")
@SequenceGenerator(sequenceName = "REQUIREMENT_SEQ", name = "REQ_SEQ", allocationSize = 1)
public class Requirement implements Serializable {

	private static final long serialVersionUID = 1L;

	private Long id;
	private String name;
	private String filter;
	private boolean multiple;
	private boolean optional;
	private boolean extend;
	private String comment;
	private List<BundleData> bundleDatas;

	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "REQ_SEQ")
	public Long getId() {
		return id;
	}

	@Column(name = "NAME", nullable = false)
	public String getName() {
		return name;
	}

	@Column(name = "FILTER", nullable = false)
	public String getFilter() {
		return filter;
	}

	@Column(name = "MULTIPLE", nullable = false)
	public boolean isMultiple() {
		return multiple;
	}

	@Column(name = "OPTIONAL", nullable = false)
	public boolean isOptional() {
		return optional;
	}

	@Column(name = "EXTEND", nullable = false)
	public boolean isExtend() {
		return extend;
	}

	@Column(name = "COMMENT_TEXT", nullable = true)
	public String getComment() {
		return comment;
	}

	@ManyToMany(mappedBy = "requirements")
	public List<BundleData> getBundleDatas() {
		return bundleDatas;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setFilter(String filter) {
		this.filter = filter;
	}

	public void setMultiple(boolean multiple) {
		this.multiple = multiple;
	}

	public void setOptional(boolean optional) {
		this.optional = optional;
	}

	public void setExtend(boolean extend) {
		this.extend = extend;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public void setBundleDatas(List<BundleData> bundleDatas) {
		this.bundleDatas = bundleDatas;
	}

}
